package com.heima.Controller;

import com.heima.Service.AdminSensitiveService;
import com.heima.model.Admin.Dtos.SensitiveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/service_6001/wemedia/api/v1/sensitive")
public class AdminSensitiveController {

    @Autowired
    AdminSensitiveService adminSensitiveService;

    @DeleteMapping("/del/{id}")
    public ResponseResult Deletesensitive(@PathVariable Integer id)
    {
        return adminSensitiveService.SensitiveDel(id);
    }

    @PostMapping("/list")
    public ResponseResult SensitiveList(@RequestBody SensitiveDto sensitiveDto)
    {
        return adminSensitiveService.GetSensitiveList(sensitiveDto);
    }

    @PostMapping("/save")
    public ResponseResult SaveSensitive(@RequestBody WmSensitive wmSensitive)
    {
        return adminSensitiveService.SAveSensitive(wmSensitive);
    }

    @PostMapping("/update")
    public ResponseResult UpdateSensitive(@RequestBody WmSensitive wmSensitive)
    {
        return adminSensitiveService.UpdateSensitive(wmSensitive);
    }

}
